const fs = require("fs")
fs.readFile("C:\\install.log", "utf-8", (err, data) => {
        if (err) {
            console.log(err)
            return
        }
        // console.log(data)
    })
    //path模块
const path = require("path")
console.log(path.sep) //路径分隔符 windows:\ linux:/
let data = fs.readFileSync("C:" + path.sep + "install.log", "utf-8")
    // console.log(data)
let p = path.join("C:", "install.log") //路径拼接
console.log(p)
let p1 = path.join("src", "sss.js") //路径拼接
console.log(p1)
let p2 = path.join("./", "sss.js") //路径拼接
console.log(p2)

let p3 = path.resolve("C", "install.log")
console.log(p3)
let p4 = path.resolve("/aaa", "install.log")
console.log(p4)
let p5 = path.resolve("bb")
console.log(p5)
console.log(path.basename(p2))
console.log(path.basename(p2, ".js"))
console.log(path.dirname(p3))
console.log(path.extname(p3))

let res1 = path.parse("C:\Users\Administrator\.anaconda")
console.log(res1)
console.log(__dirname)
console.log(__filename)